#!/bin/sh
#!/bin/sh

echo "" > .deps

echo "正在编译插件..."
make clean
make

echo "歌词搜索引擎..."
cd DownLoadLyric
sh mk all > /dev/null

cd ../

currpath=DownLoadLyric/baidu
cp $currpath/baidu ShowLyric/usr/share/ShowLyric/
cp $currpath/BDDownLoadLyric.py ShowLyric/usr/share/ShowLyric/


currpath=DownLoadLyric/google
cp $currpath/google ShowLyric/usr/share/ShowLyric/
cp $currpath/GGDownLoadLyric.py ShowLyric/usr/share/ShowLyric/

currpath=DownLoadLyric/sogou
cp $currpath/sogou ShowLyric/usr/share/ShowLyric/
cp $currpath/SGDownLoadLyric.py ShowLyric/usr/share/ShowLyric/

currpath=DownLoadLyric/ttplayer
cp $currpath/ttplayer ShowLyric/usr/share/ShowLyric/
cp $currpath/TTDownLoadLyric.py ShowLyric/usr/share/ShowLyric/

currpath=DownLoadLyric/lrc123
cp $currpath/lrc123 ShowLyric/usr/share/ShowLyric/
cp $currpath/LRC123DownLoadLyric.py ShowLyric/usr/share/ShowLyric/
cp $currpath/SimpleHtmlParse.py ShowLyric/usr/share/ShowLyric/

currpath=UI
cp $currpath/* ShowLyric/usr/share/ShowLyric/

cp ShowLyric.so ShowLyric/usr/share/ShowLyric/

cp changelog ShowLyric/usr/share/ShowLyric/
cp changelog ShowLyric/DEBIAN

sh mkcontrol $1 $2 8

cp control ShowLyric/DEBIAN

dpkg -b ShowLyric  "ShowLyric $1-$2.deb"

rm ShowLyric/usr/share/ShowLyric/*
rm ShowLyric/DEBIAN/changelog
rm ShowLyric/DEBIAN/control

make clean
